<?php

if ($this->_User->IsLoggedIn() && $this->_User->HasAccess('admin'))
{
	$html  = '<ul id="nav">';
	$html .= '<li><a href="/admin/">Website</a>
	            <ul>';
	
	for ($i = 0, $imax = count($data); $i < $imax; $i++)
	{
		$html .= '<li><img src="Images/icons/16x16-'.$data[$i]['name'].'.png" width="16" height="16" class="icon" />'.((isset($data[$i]['submenu']) && count($data[$i]['submenu']) > 1)?'<img src="Images/accordion/arrow.png" class="arrow"/>':'').'<a href="http://'.$data[$i]['url'].'">'.$data[$i]['title'].'</a>';
		
		if (isset($data[$i]['submenu']) && (count($data[$i]['submenu']) > 1))
		{
		    $html .= '<ul>';
		    
            for ($x = 0, $xmax = count($data[$i]['submenu']); $x < $xmax; $x++)
                $html .= '<li>'.((($ret = $this->_View->ThemeFile('Images/icons/16x16-'.$data[$i]['name'].'_'.$data[$i]['submenu'][$x]['name'].'.png')) !== false )?'<img src="'.$ret.'" width="16" height="16" class="icon" />':'').'<a href="http://'.$data[$i]['submenu'][$x]['url'].'">'.$data[$i]['submenu'][$x]['title'].'</a></li>';
               
            $html .= '</ul>';
		}
		
		$html .= '</li>';
	}
	
	$html .= '</ul></li>';
	
	$html .= '<li><a href="/admin/module;warlock/">Warlock</a>
	            <ul>
	              <li><img src="Images/icons/16x16-extensions.png" width="16" height="16" class="icon" /><img src="Images/accordion/arrow.png" class="arrow"/><a href="/admin/module;warlock/action;extensions/">Extensions</a>
	                <ul>
	                  <li><img src="Images/icons/16x16-extensions_install.png" width="16" height="16" class="icon" /><a href="#">Install</a></li>
	                  <li><img src="Images/icons/16x16-extensions_manage.png" width="16" height="16" class="icon" /><a href="#">Manage</a></li>
	                </ul>
	              </li>
	              <li><img src="Images/icons/16x16-settings.png" width="16" height="16" class="icon" /><img src="Images/accordion/arrow.png" class="arrow"/><a href="/admin/module;warlock/action;settings/">Settings</a>
	                <ul>
    	              <li><img src="Images/icons/16x16-modules.png" width="16" height="16" class="icon" /><a href="/admin/module;warlock/action;modules/">Modules</a></li>
    	              <li><img src="Images/icons/16x16-components.png" width="16" height="16" class="icon" /><a href="/admin/module;warlock/action;components/">Components</a></li>            
    	              <li><img src="Images/icons/16x16-plugins.png" width="16" height="16" class="icon" /><a href="/admin/module;warlock/action;plugins/">Plugins</a></li> 	                
    	              <li><img src="Images/icons/16x16-settings.png" width="16" height="16" class="icon" /><a href="/admin/module;warlock/action;plugins/">Global</a></li> 	                
	                </ul>
	              </li>                       
	            </ul>        
	          </li>
	          <li><a href="/admin/module;warlock/action;documentation/">Help</a>
	            <ul>
	              <li><a href="/admin/module;warlock/action;documentation/">Documentation</a></li>
	              <li><a href="/admin/module;warlock/action;about/">About</a></li>
	            </ul>         
	          </li>';
	
	$html .= '</ul>';
	
	return $html;
}
else 
	return '';

?>